package com.billy.ohos.loadingstatusview.wrapability;

import com.billy.ohos.loadingstatusview.ResourceTable;
import com.billy.ohos.loadingstatusview.util.AbilityUtil;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;

/**
 * entrance of wrap activity demos
 *
 * @author billy.qi
 * @since 19/3/19 21:09
 */
public class WrapAbilityAbility extends Ability {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        setUIContent(ResourceTable.Layout_ability_wrap_ability);

        findComponentById(ResourceTable.Id_btn_load_empty).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                AbilityUtil.startAbility(WrapAbilityAbility.this, GlobalEmptyAbility.class);
            }
        });

        findComponentById(ResourceTable.Id_btn_load_success).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                AbilityUtil.startAbility(WrapAbilityAbility.this, GlobalSuccessAbility.class);
            }
        });

        findComponentById(ResourceTable.Id_btn_load_failed).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                AbilityUtil.startAbility(WrapAbilityAbility.this, GlobalFailedAbility.class);
            }
        });

        findComponentById(ResourceTable.Id_btn_special).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                AbilityUtil.startAbility(WrapAbilityAbility.this, SpecialAbility.class);
            }
        });

    }
}
